<?php

class Jf_View_Helper_Action extends Jf_View_Helper_Abstract {

    public $dispatcher;

    public $request;

    public $response;

    public function __construct () {
        $this -> dispatcher = Jf_Controller_Dispatcher::getInstance ();
        $this -> request = $this -> dispatcher -> getRequest ();
        $this -> response = $this -> dispatcher -> getResponse ();
    }

    public function action ($action, $controller, $module = null, array $params = array()) {
        $this -> request -> setParams ($params) -> setModuleName ($module) -> setControllerName ($controller) -> setActionName ($action) -> setDispatched (false);
        $this -> dispatcher -> dispatch ($this -> request);
    }

}
